//思路：建立两个栈


import com.sun.deploy.security.SecureStaticVersioning;

import javax.management.remote.rmi._RMIConnection_Stub;
import java.util.*;

public class Solution {
    public static void main(String[] args) {
        String[] tokens={"10","6","9","3","+","-11","*","/","*","17","+","5","+"};
        System.out.println(evalRPN(tokens));
    }

    public static int evalRPN(String[] tokens) {
        Stack<Integer> numb = new Stack<>();
        for (int i = 0; i < tokens.length; i++) {

            if ("+-*/".contains(tokens[i])&&tokens[i].length()==1) {
                int x = numb.pop();
                int y = numb.pop();
                switch (tokens[i].charAt(0)) {
                    case '+' : {numb.push(y+x);break;}
                    case '-' : {numb.push(y-x);break;}
                    case '*' : {numb.push(y*x);break;}
                    case '/' : {numb.push(y/x);break;}
                }
            } else {
                int a = Integer.valueOf(tokens[i]);
                numb.push(a);
            }
        }
        return numb.pop();
    }
}